Integrand size = 41, antiderivative size = 118 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} \left (2 A b^2+4 a b B+a^2 (A+2 C)\right ) x+\frac {b (b B+2 a C) \text {arctanh}(\sin (c+d x))}{d}+\frac {a (A b+a B) \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \]
[Out]
Time = 0.36 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {4179, 4161, 4132, 8, 4130, 3855} \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} x \left (a^2 (A+2 C)+4 a b B+2 A b^2\right )+\frac {a (a B+A b) \sin (c+d x)}{d}+\frac {A \sin (c+d x) \cos (c+d x) (a+b \sec (c+d x))^2}{2 d}+\frac {b (2 a C+b B) \text {arctanh}(\sin (c+d x))}{d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \]
[In]
[Out]
Rule 8
Rule 3855
Rule 4130
Rule 4132
Rule 4161
Rule 4179
Rubi steps \begin{align*} \text {integral}& = \frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) (a+b \sec (c+d x)) \left (2 (A b+a B)+(2 b B+a (A+2 C)) \sec (c+d x)-b (A-2 C) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) \left (2 a (A b+a B)+\left (2 A b^2+4 a b B+a^2 (A+2 C)\right ) \sec (c+d x)+2 b (b B+2 a C) \sec ^2(c+d x)\right ) \, dx \\ & = \frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) \left (2 a (A b+a B)+2 b (b B+2 a C) \sec ^2(c+d x)\right ) \, dx+\frac {1}{2} \left (2 A b^2+4 a b B+a^2 (A+2 C)\right ) \int 1 \, dx \\ & = \frac {1}{2} \left (2 A b^2+4 a b B+a^2 (A+2 C)\right ) x+\frac {a (A b+a B) \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+(b (b B+2 a C)) \int \sec (c+d x) \, dx \\ & = \frac {1}{2} \left (2 A b^2+4 a b B+a^2 (A+2 C)\right ) x+\frac {b (b B+2 a C) \text {arctanh}(\sin (c+d x))}{d}+\frac {a (A b+a B) \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \\ \end{align*}
Time = 3.07 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.30 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {2 \left (2 A b^2+4 a b B+a^2 (A+2 C)\right ) (c+d x)-4 b (b B+2 a C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 b (b B+2 a C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\left (a^2 A+4 b^2 C+4 a (2 A b+a B) \cos (c+d x)+a^2 A \cos (2 (c+d x))\right ) \tan (c+d x)}{4 d} \]
[In]
[Out]
Time = 0.65 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.14
method | result | size |
derivativedivides | \(\frac {a^{2} A \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )+C \,a^{2} \left (d x +c \right )+2 a A b \sin \left (d x +c \right )+2 B a b \left (d x +c \right )+2 C a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,b^{2} \left (d x +c \right )+B \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \,b^{2} \tan \left (d x +c \right )}{d}\) | \(134\) |
default | \(\frac {a^{2} A \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )+C \,a^{2} \left (d x +c \right )+2 a A b \sin \left (d x +c \right )+2 B a b \left (d x +c \right )+2 C a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,b^{2} \left (d x +c \right )+B \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \,b^{2} \tan \left (d x +c \right )}{d}\) | \(134\) |
parallelrisch | \(\frac {-8 b \cos \left (d x +c \right ) \left (B b +2 C a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+8 b \cos \left (d x +c \right ) \left (B b +2 C a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (8 a A b +4 B \,a^{2}\right ) \sin \left (2 d x +2 c \right )+a^{2} A \sin \left (3 d x +3 c \right )+4 d \left (2 A \,b^{2}+4 B a b +a^{2} \left (A +2 C \right )\right ) x \cos \left (d x +c \right )+\sin \left (d x +c \right ) \left (a^{2} A +8 C \,b^{2}\right )}{8 d \cos \left (d x +c \right )}\) | \(159\) |
risch | \(\frac {a^{2} A x}{2}+x A \,b^{2}+2 x B a b +a^{2} x C -\frac {i a^{2} A \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {i a A b \,{\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {i B \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a A b}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B \,a^{2}}{2 d}+\frac {i a^{2} A \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i C \,b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,b^{2}}{d}-\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,b^{2}}{d}+\frac {2 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}\) | \(247\) |
norman | \(\frac {\left (-\frac {1}{2} a^{2} A -A \,b^{2}-2 B a b -C \,a^{2}\right ) x +\left (-\frac {1}{2} a^{2} A -A \,b^{2}-2 B a b -C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {1}{2} a^{2} A +A \,b^{2}+2 B a b +C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (\frac {1}{2} a^{2} A +A \,b^{2}+2 B a b +C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (-a^{2} A -2 A \,b^{2}-4 B a b -2 C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\left (a^{2} A +2 A \,b^{2}+4 B a b +2 C \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-\frac {2 \left (3 a^{2} A -2 C \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {\left (a^{2} A -4 a A b -2 B \,a^{2}+2 C \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}-\frac {\left (a^{2} A +4 a A b +2 B \,a^{2}+2 C \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 a \left (a A -2 A b -a B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {4 a \left (a A +2 A b +a B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}+\frac {b \left (B b +2 C a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b \left (B b +2 C a \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(453\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.25 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left ({\left (A + 2 \, C\right )} a^{2} + 4 \, B a b + 2 \, A b^{2}\right )} d x \cos \left (d x + c\right ) + {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (A a^{2} \cos \left (d x + c\right )^{2} + 2 \, C b^{2} + 2 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.25 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 8 \, {\left (d x + c\right )} B a b + 4 \, {\left (d x + c\right )} A b^{2} + 4 \, C a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a^{2} \sin \left (d x + c\right ) + 8 \, A a b \sin \left (d x + c\right ) + 4 \, C b^{2} \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (112) = 224\).
Time = 0.33 (sec) , antiderivative size = 229, normalized size of antiderivative = 1.94 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=-\frac {\frac {4 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - {\left (A a^{2} + 2 \, C a^{2} + 4 \, B a b + 2 \, A b^{2}\right )} {\left (d x + c\right )} - 2 \, {\left (2 \, C a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + 2 \, {\left (2 \, C a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 17.34 (sec) , antiderivative size = 274, normalized size of antiderivative = 2.32 \[ \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {B\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {C\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {2\,A\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d}-\frac {A\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}}{d}-\frac {A\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {B\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {B\,a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}}{d}-\frac {C\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}}{d} \]
[In]
[Out]